package com.brickworkers.codemaker.domain;

import java.util.List;

import com.brickworkers.codemaker.utils.DateUtils;
import com.brickworkers.codemaker.utils.MakerconfResource;
import com.brickworkers.codemaker.utils.StringUtils;

public class Table {
	
	private String tableName;
	private String tableNameLowcase;
	private String tableNameUpcase;
	private List<Row> rows;
	private String description;
	
	//类名
	private String className;
	
	//类名第一个小写
	private String classNameFirstLowcase;
	
	//包名
	private String packageName;
	
	private String author;
	private String createTime;
	{
		author = MakerconfResource.rb.getString("author");
		setCreateTime(DateUtils.getCurrerntTime());
	}
	
	public Table(String name) {
		tableName = name;
		setClassName(StringUtils.getClassName(name));
		setDescription(name);
		setClassNameFirstLowcase(className.substring(0, 1).toLowerCase()+className.substring(1));
	}
	
	public String getTableNameLowcase() {
		return tableNameLowcase;
	}
	public void setTableNameLowcase(String tableNameLowcase) {
		this.tableNameLowcase = tableNameLowcase;
	}
	public String getTableName() {
		return tableName;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	public String getTableNameUpcase() {
		return tableNameUpcase;
	}
	public void setTableNameUpcase(String tableNameUpcase) {
		this.tableNameUpcase = tableNameUpcase;
	}
	public List<Row> getRows() {
		return rows;
	}
	public void setRows(List<Row> rows) {
		this.rows = rows;
	}

	
	@Override
	public String toString() {
		return "tableName:"+tableName + " rows:" + rows; 
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getClassNameFirstLowcase() {
		return classNameFirstLowcase;
	}

	public void setClassNameFirstLowcase(String classNameFirstLowcase) {
		this.classNameFirstLowcase = classNameFirstLowcase;
	}

}
